/*
 * @Author: Komens
 * @Date: 2022-01-21 16:01:10
 * @LastEditTime: 2022-01-21 17:52:22
 * @LastEditors: Komens
 */
const { merge } = require("webpack-merge");
const path = require("path");
const common = require("./webpack.common.js");

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map", //控制台提示信息映射
  output: {
    filename: "[name]/index.[chunkhash].js",
    path: path.resolve(__dirname, "./.cache"),
    clean: {
      keep: /assets/,
    },
  },
  cache: {
    type: "filesystem", // 使用文件缓存
  },
  devServer: {
    static: {
      directory: path.join(__dirname, ".cache"),
    },
    open: true,
    port: 3000,
  },
});
